#!/usr/bin/env python3
# -*- coding: utf-8 -*-

from bufferedreader import *
from typing import Callable


_whitespace: set[int] = ...
__escape: dict[int, str] = ...

class SRONError (Exception):
    def __init__(self, type, message): ...
    def __str__(self): ...
    def __repr__(self): ...

def skip_whitespace(in_stream: ReadBuffer) -> None: ...
def isname_start(c: int) -> bool: ...
def isname(c: int) -> bool: ...
def escape_parser(in_stream: ReadBuffer) -> int: ...
def bool_parser(in_stream: ReadBuffer) -> bool: ...
def null_parser(in_stream: ReadBuffer) -> None: ...
def dec_parser(in_stream: ReadBuffer) -> int: ...
def hex_parser(in_stream: ReadBuffer) -> int: ...
def bin_parser(in_stream: ReadBuffer) -> int: ...
def oct_parser(in_stream: ReadBuffer) -> int: ...
def int_parser(in_stream: ReadBuffer) -> int: ...
def float_parser(in_stream: ReadBuffer) -> float: ...
def string_parser(in_stream: ReadBuffer) -> str: ...
def array_parser(in_stream: ReadBuffer, _parser: dict[str, tuple[Callable, bool]]) -> list[tuple[str, object]]: ...
def array_item_parser(in_stream: ReadBuffer, _parser: dict[str, tuple[Callable, bool]]) -> tuple[str, object]: ...

def dict_constructor(data: dict[str, tuple[str, object]], path: str, _constructor: dict[str, tuple[Callable, bool]]) -> str: ...
def array_constructor(data: list[str, tuple[str, object]], _constructor: dict[str, tuple[Callable, bool]]) -> str: ...
def float_constructor(data: float) -> str: ...
def int_constructor(data: int) -> str: ...
def string_constructor(data: str) -> str: ...
def bool_constructor(data: bool) -> str: ...
def null_constructor(data: None) -> str: ...

class SRON:
    def __init__(self):
        self._parser: dict[str, tuple[Callable, bool]] = ...
        self._constructor: dict[str, tuple[Callable, bool]] =...
    @staticmethod
    def __insert (d: dict[str, tuple[str, object]], path: list[str], typeof: str, value: object): ...
    def parse_path(self, in_stream: ReadBuffer) -> list[str]: ...
    def parse_type(self, in_stream: ReadBuffer) -> str: ...
    def parse_line (self, in_stream: ReadBuffer) -> tuple[str, str, object]: ...
    def parse_value (self, in_stream: ReadBuffer, typeof: str) -> tuple[str, object]: ...
    def parse(self, in_stream: ReadBuffer) -> dict[str, tuple[str, object]]: ...
    def construct(self, data: dict[str, tuple[str, object]]) -> str: ...
    def __call__ (self, in_stream: ReadBuffer | str | bytes | bytearray | dict[str, tuple[str, object]]) -> object: ...
    def push_parser(self, typeof: str, parser: Callable, need_parser_table: bool) -> None:...
    def pop_parser(self, typeof: str) -> None:...
    def push_constructor(self, typeof: str, constructor: Callable, need_constructor_table: bool) -> None:...
    def pop_constructor(self, typeof: str) -> None:...